namespace InventoryManagement
{
	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.Data;
	using System.Data.SqlClient;
	using System.Text;
	
	
	public class Inventory_Network : BaseTable
	{
		
		#region Static SQL String Members
		/// <remarks>This field represents the full SELECT string for the table Inventory Network, with the WHERE clause.</remarks>
		internal static string _SQL_Select = @"SELECT [ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [LabelName], [SystemClass], [ID_DataCabang], [StartFrom], [IP], [HostName], [PathNumber], [SerialNumber], [LANPort], [WANPort], [FirmwareVersion], [Notes], [URLAttachment], [IsDeleted] FROM [dbo].[Inventory Network] WHERE [ID]=@ID ";
		
		/// <remarks>This field represents the full SELECT string for the table Inventory Network, with the WHERE clause.</remarks>
		internal static string _SQL_SelectByParam = "SELECT [ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [LabelName], [SystemClass], [ID_DataCabang], [StartFrom], [IP], [HostName], [PathNumber], [SerialNumber], [LANPort], [WANPort], [FirmwareVersion], [Notes], [URLAttachment], [IsDeleted] FROM [dbo].[Inventory Network] WHERE isnull(convert(varchar(36),[ID]),\'true\')=isnull(convert(varchar(36),@ID),isnull(convert(varchar(36),[ID]),\'true\')) AND isnull(convert(varchar(36),[ID_SysBrand]),\'true\')=isnull(convert(varchar(36),@ID_SysBrand),isnull(convert(varchar(36),[ID_SysBrand]),\'true\')) AND isnull(convert(varchar(36),[ID_SysType]),\'true\')=isnull(convert(varchar(36),@ID_SysType),isnull(convert(varchar(36),[ID_SysType]),\'true\')) AND isnull(convert(varchar,[InventoryBy]),\'true\')=isnull(convert(varchar,@InventoryBy),isnull(convert(varchar,[InventoryBy]),\'true\')) AND isnull(convert(varchar,[InventoryDate]),\'true\')=isnull(convert(varchar,@InventoryDate),isnull(convert(varchar,[InventoryDate]),\'true\')) AND isnull(convert(varchar(36),[ID_RackNumber]),\'true\')=isnull(convert(varchar(36),@ID_RackNumber),isnull(convert(varchar(36),[ID_RackNumber]),\'true\')) AND isnull(convert(varchar,[LabelName]),\'true\')=isnull(convert(varchar,@LabelName),isnull(convert(varchar,[LabelName]),\'true\')) AND isnull(convert(varchar,[SystemClass]),\'true\')=isnull(convert(varchar,@SystemClass),isnull(convert(varchar,[SystemClass]),\'true\')) AND isnull(convert(varchar(36),[ID_DataCabang]),\'true\')=isnull(convert(varchar(36),@ID_DataCabang),isnull(convert(varchar(36),[ID_DataCabang]),\'true\')) AND isnull(convert(varchar,[StartFrom]),\'true\')=isnull(convert(varchar,@StartFrom),isnull(convert(varchar,[StartFrom]),\'true\')) AND isnull(convert(varchar,[IP]),\'true\')=isnull(convert(varchar,@IP),isnull(convert(varchar,[IP]),\'true\')) AND isnull(convert(varchar,[HostName]),\'true\')=isnull(convert(varchar,@HostName),isnull(convert(varchar,[HostName]),\'true\')) AND isnull(convert(varchar,[PathNumber]),\'true\')=isnull(convert(varchar,@PathNumber),isnull(convert(varchar,[PathNumber]),\'true\')) AND isnull(convert(varchar,[SerialNumber]),\'true\')=isnull(convert(varchar,@SerialNumber),isnull(convert(varchar,[SerialNumber]),\'true\')) AND isnull(convert(varchar,[LANPort]),\'true\')=isnull(convert(varchar,@LANPort),isnull(convert(varchar,[LANPort]),\'true\')) AND isnull(convert(varchar,[WANPort]),\'true\')=isnull(convert(varchar,@WANPort),isnull(convert(varchar,[WANPort]),\'true\')) AND isnull(convert(varchar,[FirmwareVersion]),\'true\')=isnull(convert(varchar,@FirmwareVersion),isnull(convert(varchar,[FirmwareVersion]),\'true\')) AND isnull(convert(varchar,[Notes]),\'true\')=isnull(convert(varchar,@Notes),isnull(convert(varchar,[Notes]),\'true\')) AND isnull(convert(varchar,[URLAttachment]),\'true\')=isnull(convert(varchar,@URLAttachment),isnull(convert(varchar,[URLAttachment]),\'true\')) AND isnull(convert(varchar,[IsDeleted]),\'true\')=isnull(convert(varchar,@IsDeleted),isnull(convert(varchar,[IsDeleted]),\'true\')) ";
		
		/// <remarks>This field represents the full INSERT INTO string for the table Inventory Network.</remarks>
		internal static string _SQL_Insert = @"INSERT INTO [dbo].[Inventory Network] ([ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [LabelName], [SystemClass], [ID_DataCabang], [StartFrom], [IP], [HostName], [PathNumber], [SerialNumber], [LANPort], [WANPort], [FirmwareVersion], [Notes], [URLAttachment], [IsDeleted]) VALUES(@ID, @ID_SysBrand, @ID_SysType, @InventoryBy, @InventoryDate, @ID_RackNumber, @LabelName, @SystemClass, @ID_DataCabang, @StartFrom, @IP, @HostName, @PathNumber, @SerialNumber, @LANPort, @WANPort, @FirmwareVersion, @Notes, @URLAttachment, @IsDeleted) ";
		
		/// <remarks>This field represents the full UPDATE string for the table Inventory Network, with the WHERE clause.</remarks>
		internal static string _SQL_Update = @"UPDATE [dbo].[Inventory Network] SET [ID] = @ID, [ID_SysBrand] = @ID_SysBrand, [ID_SysType] = @ID_SysType, [InventoryBy] = @InventoryBy, [InventoryDate] = @InventoryDate, [ID_RackNumber] = @ID_RackNumber, [LabelName] = @LabelName, [SystemClass] = @SystemClass, [ID_DataCabang] = @ID_DataCabang, [StartFrom] = @StartFrom, [IP] = @IP, [HostName] = @HostName, [PathNumber] = @PathNumber, [SerialNumber] = @SerialNumber, [LANPort] = @LANPort, [WANPort] = @WANPort, [FirmwareVersion] = @FirmwareVersion, [Notes] = @Notes, [URLAttachment] = @URLAttachment, [IsDeleted] = @IsDeleted WHERE [ID]=@ID ";
		
		/// <remarks>This field represents the DELETE string for the table Inventory Network, with the WHERE clause.</remarks>
		internal static string _SQL_Delete = "DELETE FROM [dbo].[Inventory Network] WHERE [ID]=@ID ";
		#endregion
		
		#region Tables Members
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID;
		
		[DisplayName("ID")]
		[Category("Primary Key")]
		public System.Nullable<System.Guid> ID
		{
			get
			{
				try
				{
					return _ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID", err);
				}
			}
			set
			{
				try
				{
					_ID = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_SysBrand;
		
		[DisplayName("ID_Sys Brand")]
		[Category("Column")]
		public System.Nullable<System.Guid> ID_SysBrand
		{
			get
			{
				try
				{
					return _ID_SysBrand;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_SysBrand", err);
				}
			}
			set
			{
				try
				{
					_ID_SysBrand = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_SysBrand", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_SysType;
		
		[DisplayName("ID_Sys Type")]
		[Category("Column")]
		public System.Nullable<System.Guid> ID_SysType
		{
			get
			{
				try
				{
					return _ID_SysType;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_SysType", err);
				}
			}
			set
			{
				try
				{
					_ID_SysType = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_SysType", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _InventoryBy;
		
		[DisplayName("Inventory By")]
		[Category("Column")]
		public string InventoryBy
		{
			get
			{
				try
				{
					return _InventoryBy;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting InventoryBy", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_InventoryBy = value;
					}
					else
					{
						throw new OverflowException("Error setting InventoryBy, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting InventoryBy", err);
				}
			}
		}
		
		/// <remarks>SQL Type:datetime - </remarks>
		private System.Nullable<System.DateTime> _InventoryDate;
		
		[DisplayName("Inventory Date")]
		[Category("Column")]
		public System.Nullable<System.DateTime> InventoryDate
		{
			get
			{
				try
				{
					return _InventoryDate;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting InventoryDate", err);
				}
			}
			set
			{
				try
				{
					_InventoryDate = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting InventoryDate", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_RackNumber;
		
		[DisplayName("ID_Rack Number")]
		[Category("Column")]
		public System.Nullable<System.Guid> ID_RackNumber
		{
			get
			{
				try
				{
					return _ID_RackNumber;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_RackNumber", err);
				}
			}
			set
			{
				try
				{
					_ID_RackNumber = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_RackNumber", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _LabelName;
		
		[DisplayName("Label Name")]
		[Category("Column")]
		public string LabelName
		{
			get
			{
				try
				{
					return _LabelName;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting LabelName", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_LabelName = value;
					}
					else
					{
						throw new OverflowException("Error setting LabelName, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting LabelName", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _SystemClass;
		
		[DisplayName("System Class")]
		[Category("Column")]
		public string SystemClass
		{
			get
			{
				try
				{
					return _SystemClass;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting SystemClass", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_SystemClass = value;
					}
					else
					{
						throw new OverflowException("Error setting SystemClass, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting SystemClass", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_DataCabang;
		
		[DisplayName("ID_Data Cabang")]
		[Category("Column")]
		public System.Nullable<System.Guid> ID_DataCabang
		{
			get
			{
				try
				{
					return _ID_DataCabang;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_DataCabang", err);
				}
			}
			set
			{
				try
				{
					_ID_DataCabang = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_DataCabang", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _StartFrom;
		
		[DisplayName("Start From")]
		[Category("Column")]
		public string StartFrom
		{
			get
			{
				try
				{
					return _StartFrom;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting StartFrom", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_StartFrom = value;
					}
					else
					{
						throw new OverflowException("Error setting StartFrom, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting StartFrom", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _IP;
		
		[DisplayName("IP")]
		[Category("Column")]
		public string IP
		{
			get
			{
				try
				{
					return _IP;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting IP", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_IP = value;
					}
					else
					{
						throw new OverflowException("Error setting IP, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting IP", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _HostName;
		
		[DisplayName("Host Name")]
		[Category("Column")]
		public string HostName
		{
			get
			{
				try
				{
					return _HostName;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting HostName", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_HostName = value;
					}
					else
					{
						throw new OverflowException("Error setting HostName, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting HostName", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _PathNumber;
		
		[DisplayName("Path Number")]
		[Category("Column")]
		public string PathNumber
		{
			get
			{
				try
				{
					return _PathNumber;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting PathNumber", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_PathNumber = value;
					}
					else
					{
						throw new OverflowException("Error setting PathNumber, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting PathNumber", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _SerialNumber;
		
		[DisplayName("Serial Number")]
		[Category("Column")]
		public string SerialNumber
		{
			get
			{
				try
				{
					return _SerialNumber;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting SerialNumber", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_SerialNumber = value;
					}
					else
					{
						throw new OverflowException("Error setting SerialNumber, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting SerialNumber", err);
				}
			}
		}
		
		/// <remarks>SQL Type:int - </remarks>
		private System.Nullable<int> _LANPort;
		
		[DisplayName("LANPort")]
		[Category("Column")]
		public System.Nullable<int> LANPort
		{
			get
			{
				try
				{
					return _LANPort;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting LANPort", err);
				}
			}
			set
			{
				try
				{
					_LANPort = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting LANPort", err);
				}
			}
		}
		
		/// <remarks>SQL Type:int - </remarks>
		private System.Nullable<int> _WANPort;
		
		[DisplayName("WANPort")]
		[Category("Column")]
		public System.Nullable<int> WANPort
		{
			get
			{
				try
				{
					return _WANPort;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting WANPort", err);
				}
			}
			set
			{
				try
				{
					_WANPort = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting WANPort", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _FirmwareVersion;
		
		[DisplayName("Firmware Version")]
		[Category("Column")]
		public string FirmwareVersion
		{
			get
			{
				try
				{
					return _FirmwareVersion;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting FirmwareVersion", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_FirmwareVersion = value;
					}
					else
					{
						throw new OverflowException("Error setting FirmwareVersion, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting FirmwareVersion", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Notes;
		
		[DisplayName("Notes")]
		[Category("Column")]
		public string Notes
		{
			get
			{
				try
				{
					return _Notes;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Notes", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 1000))
					{
						_Notes = value;
					}
					else
					{
						throw new OverflowException("Error setting Notes, Length of value is to long. Maximum Length: 1000");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Notes", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _URLAttachment;
		
		[DisplayName("URLAttachment")]
		[Category("Column")]
		public string URLAttachment
		{
			get
			{
				try
				{
					return _URLAttachment;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting URLAttachment", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_URLAttachment = value;
					}
					else
					{
						throw new OverflowException("Error setting URLAttachment, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting URLAttachment", err);
				}
			}
		}
		
		/// <remarks>SQL Type:bit - </remarks>
		private System.Nullable<bool> _IsDeleted;
		
		[DisplayName("Is Deleted")]
		[Category("Column")]
		public System.Nullable<bool> IsDeleted
		{
			get
			{
				try
				{
					return _IsDeleted;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting IsDeleted", err);
				}
			}
			set
			{
				try
				{
					_IsDeleted = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting IsDeleted", err);
				}
			}
		}
		#endregion
		
		#region Related Object Collections
		/// <remarks>Represents the foreign key object</remarks>
		private Modul_DetailCollection _Modul_DetailCollection;
		
		[Description("Represents the foreign key relation. This is an Collection of Inventory_Network.")]
		public Modul_DetailCollection Modul_DetailCollection
		{
			get
			{
				try
				{
					return _Modul_DetailCollection;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Modul_DetailCollection", err);
				}
			}
			set
			{
				try
				{
					_Modul_DetailCollection = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Modul_DetailCollection", err);
				}
			}
		}
		#endregion
		
		#region Public Methods
		public void Select()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_Network._SQL_Select;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				SqlDataReader rs = Com.ExecuteReader();
				while(rs.Read())
				{
					AddFromRecordSet(rs);
				}
				rs.Close();
				Conn.Close();
				rs.Dispose();
				Com.Dispose();
				Conn.Dispose();
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public System.Data.DataTable SelectByParam()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_Network._SQL_SelectByParam;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				SqlDataAdapter objDataAdapter = new SqlDataAdapter(Com);
				DataTable objDataTable = new DataTable();
				objDataAdapter.Fill(objDataTable);
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return objDataTable;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Insert()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_Network._SQL_Insert;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Update()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_Network._SQL_Update;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Delete()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_Network._SQL_Delete;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public string[] GetSqlCommandStrings()
		{
			try
			{
				string[] CommStr = new string[4];
				CommStr[0] = "SELECT [ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [LabelName], [SystemClass], [ID_DataCabang], [StartFrom], [IP], [HostName], [PathNumber], [SerialNumber], [LANPort], [WANPort], [FirmwareVersion], [Notes], [URLAttachment], [IsDeleted] FROM [dbo].[Inventory Network] WHERE [ID] = " + _ID + "";
				CommStr[1] = "INSERT INTO [dbo].[Inventory Network] ([ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [LabelName], [SystemClass], [ID_DataCabang], [StartFrom], [IP], [HostName], [PathNumber], [SerialNumber], [LANPort], [WANPort], [FirmwareVersion], [Notes], [URLAttachment], [IsDeleted]) VALUES(" + _ID + ", " + _ID_SysBrand + ", " + _ID_SysType + ", '" + _InventoryBy.Replace("'","''") + "', '" + _InventoryDate + "', " + _ID_RackNumber + ", '" + _LabelName.Replace("'","''") + "', '" + _SystemClass.Replace("'","''") + "', " + _ID_DataCabang + ", '" + _StartFrom.Replace("'","''") + "', '" + _IP.Replace("'","''") + "', '" + _HostName.Replace("'","''") + "', '" + _PathNumber.Replace("'","''") + "', '" + _SerialNumber.Replace("'","''") + "', " + _LANPort + ", " + _WANPort + ", '" + _FirmwareVersion.Replace("'","''") + "', '" + _Notes.Replace("'","''") + "', '" + _URLAttachment.Replace("'","''") + "', " + _IsDeleted + ")";
				CommStr[2] = "UPDATE [dbo].[Inventory Network] SET [ID_SysBrand] = " + _ID_SysBrand + " ,[ID_SysType] = " + _ID_SysType + " ,[InventoryBy] = '" + _InventoryBy.Replace("'","''") + "' ,[InventoryDate] = '" + _InventoryDate + "' ,[ID_RackNumber] = " + _ID_RackNumber + " ,[LabelName] = '" + _LabelName.Replace("'","''") + "' ,[SystemClass] = '" + _SystemClass.Replace("'","''") + "' ,[ID_DataCabang] = " + _ID_DataCabang + " ,[StartFrom] = '" + _StartFrom.Replace("'","''") + "' ,[IP] = '" + _IP.Replace("'","''") + "' ,[HostName] = '" + _HostName.Replace("'","''") + "' ,[PathNumber] = '" + _PathNumber.Replace("'","''") + "' ,[SerialNumber] = '" + _SerialNumber.Replace("'","''") + "' ,[LANPort] = " + _LANPort + " ,[WANPort] = " + _WANPort + " ,[FirmwareVersion] = '" + _FirmwareVersion.Replace("'","''") + "' ,[Notes] = '" + _Notes.Replace("'","''") + "' ,[URLAttachment] = '" + _URLAttachment.Replace("'","''") + "' ,[IsDeleted] = " + _IsDeleted + " WHERE [ID] = " + _ID + "";
				CommStr[3] = "DELETE FROM [dbo].[Inventory Network] WHERE [ID] = " + _ID + "";
				return CommStr;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		#endregion
		
		#region Private Methods
		private void AddFromRecordSet(SqlDataReader rs)
		{
			try
			{
				// if value from the recordset, to the ID field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID")) == false))
				{
					ID = rs.GetGuid(rs.GetOrdinal("ID"));
				}
				// if value from the recordset, to the ID_SysBrand field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_SysBrand")) == false))
				{
					ID_SysBrand = rs.GetGuid(rs.GetOrdinal("ID_SysBrand"));
				}
				// if value from the recordset, to the ID_SysType field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_SysType")) == false))
				{
					ID_SysType = rs.GetGuid(rs.GetOrdinal("ID_SysType"));
				}
				// if value from the recordset, to the InventoryBy field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("InventoryBy")) == false))
				{
					InventoryBy = rs.GetString(rs.GetOrdinal("InventoryBy"));
				}
				// if value from the recordset, to the InventoryDate field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("InventoryDate")) == false))
				{
					InventoryDate = rs.GetDateTime(rs.GetOrdinal("InventoryDate"));
				}
				// if value from the recordset, to the ID_RackNumber field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_RackNumber")) == false))
				{
					ID_RackNumber = rs.GetGuid(rs.GetOrdinal("ID_RackNumber"));
				}
				// if value from the recordset, to the LabelName field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("LabelName")) == false))
				{
					LabelName = rs.GetString(rs.GetOrdinal("LabelName"));
				}
				// if value from the recordset, to the SystemClass field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("SystemClass")) == false))
				{
					SystemClass = rs.GetString(rs.GetOrdinal("SystemClass"));
				}
				// if value from the recordset, to the ID_DataCabang field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_DataCabang")) == false))
				{
					ID_DataCabang = rs.GetGuid(rs.GetOrdinal("ID_DataCabang"));
				}
				// if value from the recordset, to the StartFrom field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("StartFrom")) == false))
				{
					StartFrom = rs.GetString(rs.GetOrdinal("StartFrom"));
				}
				// if value from the recordset, to the IP field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("IP")) == false))
				{
					IP = rs.GetString(rs.GetOrdinal("IP"));
				}
				// if value from the recordset, to the HostName field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("HostName")) == false))
				{
					HostName = rs.GetString(rs.GetOrdinal("HostName"));
				}
				// if value from the recordset, to the PathNumber field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("PathNumber")) == false))
				{
					PathNumber = rs.GetString(rs.GetOrdinal("PathNumber"));
				}
				// if value from the recordset, to the SerialNumber field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("SerialNumber")) == false))
				{
					SerialNumber = rs.GetString(rs.GetOrdinal("SerialNumber"));
				}
				// if value from the recordset, to the LANPort field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("LANPort")) == false))
				{
					LANPort = rs.GetInt32(rs.GetOrdinal("LANPort"));
				}
				// if value from the recordset, to the WANPort field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("WANPort")) == false))
				{
					WANPort = rs.GetInt32(rs.GetOrdinal("WANPort"));
				}
				// if value from the recordset, to the FirmwareVersion field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("FirmwareVersion")) == false))
				{
					FirmwareVersion = rs.GetString(rs.GetOrdinal("FirmwareVersion"));
				}
				// if value from the recordset, to the Notes field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Notes")) == false))
				{
					Notes = rs.GetString(rs.GetOrdinal("Notes"));
				}
				// if value from the recordset, to the URLAttachment field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("URLAttachment")) == false))
				{
					URLAttachment = rs.GetString(rs.GetOrdinal("URLAttachment"));
				}
				// if value from the recordset, to the IsDeleted field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("IsDeleted")) == false))
				{
					IsDeleted = rs.GetBoolean(rs.GetOrdinal("IsDeleted"));
				}
			}
			catch (SqlException sqlExc)
			{
				throw sqlExc;
			}
			catch (Exception Exc)
			{
				throw Exc;
			}
		}
		
		private SqlParameter[] GetSqlParameters()
		{
			List<SqlParameter> SqlParmColl = new List<SqlParameter>();
			try
			{
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID", ID, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_SysBrand", ID_SysBrand, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_SysType", ID_SysType, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@InventoryBy", InventoryBy, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@InventoryDate", InventoryDate, SqlDbType.DateTime));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_RackNumber", ID_RackNumber, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@LabelName", LabelName, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@SystemClass", SystemClass, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_DataCabang", ID_DataCabang, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@StartFrom", StartFrom, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@IP", IP, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@HostName", HostName, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@PathNumber", PathNumber, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@SerialNumber", SerialNumber, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@LANPort", LANPort, SqlDbType.Int));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@WANPort", WANPort, SqlDbType.Int));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@FirmwareVersion", FirmwareVersion, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Notes", Notes, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@URLAttachment", URLAttachment, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@IsDeleted", IsDeleted, SqlDbType.Bit));
				return SqlParmColl.ToArray();
			}
			catch (Exception Exc)
			{
				throw Exc;
			}
		}
		#endregion
	}
	
	public class Inventory_NetworkCollection : System.Collections.CollectionBase
	{
		
		[Description("Adds a new Inventory_Network to the collection.")]
		public int Add(Inventory_Network item)
		{
			int newindex = List.Add(item);
			return newindex;
		}
		
		[Description("Removes a Inventory_Network from the collection.")]
		public void Remove(Inventory_Network item)
		{
			List.Remove(item);
		}
		
		[Description("Inserts an Inventory_Network into the collection at the specified index.")]
		public void Insert(int index, Inventory_Network item)
		{
			List.Insert(index, item);
		}
		
		[Description("Returns the index value of the Inventory_Network class in the collection.")]
		public int IndexOf(Inventory_Network item)
		{
			return List.IndexOf(item);
		}
		
		[Description("Returns true if the Inventory_Network class is present in the collection.")]
		public bool Contains(Inventory_Network item)
		{
			return List.Contains(item);
		}
	}
	
	public enum Inventory_Network_Fields
	{
		
		ID,
		
		ID_SysBrand,
		
		ID_SysType,
		
		InventoryBy,
		
		InventoryDate,
		
		ID_RackNumber,
		
		LabelName,
		
		SystemClass,
		
		ID_DataCabang,
		
		StartFrom,
		
		IP,
		
		HostName,
		
		PathNumber,
		
		SerialNumber,
		
		LANPort,
		
		WANPort,
		
		FirmwareVersion,
		
		Notes,
		
		URLAttachment,
		
		IsDeleted,
	}
}
